'user strict';
import React, {
    Component
} from 'react';

export default class ConfirmBox extends Component {
    constructor(props) {
        super(props);
        this.state = {
            dataLoad: 0,
            dataNull: 0,
            dataEnd: 0
        };
    }
    componentWillReceiveProps() {
        setTimeout(() => {
            this.setState({
                dataLoad: this.props.dataLoad,
                dataNull: this.props.dataNull,
                dataEnd: this.props.dataEnd
            });
        }, 0)
    }
    render() {
        let {
            dataLoad,
            dataNull,
            dataEnd,
            dataNullMsg
        } = this.props;
        let {
            show
        } = this.state;
        return (
            <div className='datastatus'>
                {dataLoad == 1
                    ? <span className='ing'>加载中...</span>
                    : ''}
                {dataNull == 1
                    ? <span className='no'>{dataNullMsg?dataNullMsg:'暂无信息'}</span>
                    : ''}
                {/*dataEnd == 1
                    ? <span className='end'>已加载全部信息</span>
                    : ''*/}
            </div>
        )
    }
}
